package com.api.shopapi.mapper;

import com.api.shopapi.entity.ElderlyDiseaseTypeRel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ElderlyDiseaseTypeRelMapper {



    @Insert("insert into elderly_disease_type_rel " +
            "(" +
            "ElderlyDiseaseTypeRelCode," +
            "ElderlyCode," +
            "DiseaseTypeCode" +
            ") " +
            "values " +
            "(" +
            "#{elderlyDiseaseTypeRel.ElderlyDiseaseTypeRelCode}," +
            "#{elderlyDiseaseTypeRel.ElderlyCode}," +
            "#{elderlyDiseaseTypeRel.DiseaseTypeCode}" +
            ")" )
    int insert(@Param("elderlyDiseaseTypeRel") ElderlyDiseaseTypeRel elderlyDiseaseTypeRel);


    @Delete("delete from elderly_disease_type_rel where elderlyDiseaseTypeRelCode=#{elderlyDiseaseTypeRelCode}")
    int delete(@Param("elderlyDiseaseTypeRelCode") String elderlyDiseaseTypeRelCode);


    @Select("select * from elderly_disease_type_rel where elderlyCode=#{elderlyCode}")
    List<ElderlyDiseaseTypeRel> ListByElderlyCode(@Param("elderlyCode") String elderlyCode);


}
